package com.caregiver.watch.common.utils.number;

import java.math.BigDecimal;
import java.util.Optional;

/**
 * @Description: BigDecimal工具
 * @Author 疆戟
 * @Date 2025/9/24 22:32
 * @Version 1.0
 */
public final class BigDecimalUtils {


    public static BigDecimal valueOf(float value) {
        return new BigDecimal(String.valueOf(value));
    }


    public static BigDecimal ofNullable(BigDecimal value) {
        return Optional.ofNullable(value).orElse(BigDecimal.ZERO);
    }
}
